package mvc.model
{
	/**
	 * @author maliu
	 */
	public class DataModel
	{
		public var type:int;
		public var id:int;
		public var title:String;
		public var rankCurrent:int;
		public var rankMax:int;
		public var preID:int;
		public var prePoint:int;
		public var contentList:Vector.<String>;
		
		public function DataModel(_type:int, _data:Object = null)
		{
			if(_data)
			{
				if(_data is XML)
				{
					this.type = _type;
					this.id = int(_data.@id);
					this.title = _data.title;
					this.rankMax = _data.content.children().length();
//					trace(rankMax);
					this.preID = int(_data.preCondition.@preID);
					this.prePoint = int(_data.preCondition.@point);
					
					this.contentList = new Vector.<String>();
					for each(var t_xml:XML in _data.content.children())
					{
						this.contentList.push(t_xml);
//						trace(t_xml);
					}
//					trace(JSON.stringify(contentList));
				}
			}
		}
	}
}
